#ifndef MENU_H_
#define MENU_H_

#define DEBUG

#include <iostream>
#include <string>
#include <stdexcept>
#include <vector>
#include <iostream> // RA C3
#include <fstream>  // RA C3

//other types
#include "Category.h"
#include "Product.h"
#include "Customer.h"
#include "Cart.h"
#include "Cart_item.h"
#include "ShowFindUpdateRA.h"
#include "ShowFindUpdateRT.h"   // RA S2
#include "OtherRT.h"            // RA C3

using namespace std;

class Menu {
public:
    struct InvalidData : std::runtime_error {
        InvalidData() : runtime_error("Invalid input data format") {
        }
    };

    struct InvalidFile : std::runtime_error {
        InvalidFile() : runtime_error("Invalid input file name") {
        }
    };

    enum Main_menu_options {
        Info = 1, Read, Show, Find, Update, Exit
    };

    Menu();

    void display_main_menu() const;
    void display_info() const;
    void read();
    void update();
    void show() const;
    void find() const;

    // getter
    vector<Category> get_cats() { //VSR B3
        return cats;
    }

    vector<Product> get_prods() { //VSR B3
        return prods;
    }

    vector<Customer> get_custs() { //VSR B3
        return custs;
    }

    vector<Cart> get_carts() { //VSR B3
        return carts;
    }

    vector<Cart_item> get_cart_items() { //VSR B3
        return cart_items;
    }
    
    /**
     * RA C3
     * @return Customer file name
     */
    string get_cust_filename() const {
        return cust_filename;
    }
    
    /**
     * RA C3
     * @return Cart and Cart items file name
     */
    string get_carts_filename() const {
        return cart_filename;
    }
    
    /**
     * RA C3
     * @return Category and Product file name
     */
    string get_catprd_filename() const {
        return catpro_filename;
    }
    
    // setter
    void set_cats(vector<Category> m) {
    }

    void set_prods(vector<Product> m) {
    }

    void set_custs(vector<Customer> m) {
    }

    void set_carts(vector<Cart> m) {
    }

    void set_cart_items(vector<Cart_item> m) {
    }

private:
    //private data
    vector<Category> cats;
    vector<Product> prods;
    vector<Customer> custs;
    vector<Cart> carts;
    vector<Cart_item> cart_items;
    
    string cust_filename;   // Customer file name               RA C3
    string cart_filename;   // Cart and Cart items file name    RA C3
    string catpro_filename; // Category and Product file name   RA C3

    void read_cust();
    void read_cart();
    void read_category_and_product();
};

#endif //MENU_H_
